﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using NPlot;
using PlotSurface2D=NPlot.Windows.PlotSurface2D;

namespace SleepMonitor.App.UI.Charts
{
	public partial class LineChart : UserControl
	{
		private readonly LinePlot _defaultPlot;

		public LineChart()
		{
			InitializeComponent();
			_defaultPlot = new LinePlot();
		}

		/// <summary>
		/// Handles the Load event of the LineChart control.
		/// </summary>
		/// <param name="sender">The source of the event.</param>
		/// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
		private void LineChart_Load(object sender, EventArgs e)
		{
			plotSurface2D1.AddInteraction(new PlotSurface2D.Interactions.HorizontalDrag());

			plotSurface2D1.Add(_defaultPlot);
		}

		public void AddSerie(IList<object> items)
		{
		}
	}

	/// <summary>
	/// 
	/// </summary>
	public class HorizontalRangeMark : PlotSurface2D.Interactions.HorizontalRangeSelection
	{
		private int xStart;

		public override bool DoMouseDown(MouseEventArgs e, Control ctr)
		{
			xStart = e.X;
			return base.DoMouseDown(e, ctr);
		}

		public override bool DoMouseUp(MouseEventArgs e, Control ctr)
		{
			var plotSurface = (PlotSurface2D) ctr;
			return true;
		}
	}
}
